package org.opens.javaskill.enums;

public enum Source {
    // 1公众号 2小程序 3APP 4H5 5PC 6电话
    OFFICIAL_ACCOUNT(1, "公众号"),
    APPLET(2, "小程序"),
    APP(3, "小程序"),
    H5(4, "小程序"),
    PC(5, "小程序"),
    PHONE(6, "小程序");

    private Integer value;

    private String message;

    Source(Integer value, String message) {
        this.value = value;
        this.message = message;
    }

    public Integer getValue() {
        return this.value;
    }

    public Channel getChannel() {
        switch (this) {
            case OFFICIAL_ACCOUNT:
            case APPLET:
            case APP:
            case H5:
            case PC:
                return Channel.INTERNET;
            case PHONE:
                return Channel.PHONE;
        }
        throw new NullPointerException("查找了不存在的枚举类型");
    }

}


